package com.skyline.energy.factory;

import com.skyline.energy.cache.CacheManager;
import com.skyline.energy.dataaccess.jdbc.JdbcDataAccessor;
import com.skyline.energy.interceptor.DataAccessInterceptor;

public class CacheableDaoFactory extends AbstractDaoFactory {
	private CacheManager cacheManager;
	private JdbcDataAccessor dataAccessor;

	public synchronized DataAccessInterceptor getDataAccessInterceptor() {
		DataAccessInterceptor interceptor = new DataAccessInterceptor(cacheManager, dataAccessor);
		return interceptor;
	}

	public void setCacheManager(CacheManager cacheManager) {
		this.cacheManager = cacheManager;
	}

	public void setDataAccessor(JdbcDataAccessor dataAccessor) {
		this.dataAccessor = dataAccessor;
	}
}
